import redis

class Config(object):
    '''配置信息'''
    DEBUG = True
    SECRET_KEY = "XJGO98SDFSHGHGW"
    # 数据库SQLALCHEMY_DATABASE_URI,SQLALCHEMY_TRACK_MODIFICATIONS
    SQLALCHEMY_DATABASE_URI = "mysql+pymysql://root:lzq518@127.0.0.1:3306/vue_shop?charset=utf8"
    SQLALCHEMY_TRACK_MODIFICATIONS = True
    # redis
    REDIS_HOST = "192.168.158.129"
    REDIS_PORT = "6379"
    # flask_session
    SESSION_TYPE = "redis"
    SESSION_REDIS = redis.StrictRedis(host=REDIS_HOST, port=REDIS_PORT, db=1)
    SESSION_USE_SINGER = True  # 对cookie中的sessionid进行影藏
    PERMANERNT_SESSION_LIFETIME = 3600 * 24


class DevelopmentConfig(Config):
    '''开发环境'''
    pass
class ProductConfig(Config):
    '''生产环境'''
    pass
config_map = {
    'develop': DevelopmentConfig,
    'product': ProductConfig
}
